package system.task.events;

import lombok.Getter;
import org.springframework.context.ApplicationEvent;
import system.task.defined.TaskRunStatus;

import java.util.Date;
import java.util.Map;

/**
 * 任务启动事件
 */
public class TaskFinishedEvent extends ApplicationEvent {
    @Getter
    private final String name;
    @Getter
    private final String runId;
    @Getter
    private final Date startTime;
    @Getter
    private final Date endTime;
    @Getter
    private final TaskRunStatus status;
    @Getter
    private final String msg;
    @Getter
    private final Map param;

    public TaskFinishedEvent(String name, String runId, TaskRunStatus status, Date startTime, Date endTime, String msg, Map param) {
        super(name);
        this.name = name;
        this.runId = runId;
        this.startTime = startTime;
        this.endTime = endTime;
        this.status = status;
        this.msg = msg;
        this.param = param;
    }
}
